package cn.edu.scau.cmi.chenyiqiu.classAdapter;

import java.util.*;

public class SortAdapterOfClass extends SortUnit implements Target{

	@Override
	public List<StudentInfo> sortStu(List<StudentInfo> students) {
		List<Integer> list=new ArrayList<Integer>();
		StudentInfo t;
		for(int i=0;i<students.size();i++) {
			list.add(students.get(i).getnumber());
		}
		sortInt(list);
		for(int i=0;i<students.size();i++)
		{
			for(int j=i+1;j<students.size();j++)
			{
				if(students.get(j).getnumber()==list.get(i))
				{
					t=students.get(i);
					students.set(i,students.get(j));
					students.set(j, t);
				}
			}
		}
		return students;
	}


}
